import java.util.*;

public class Solution187 {
    public List<String> findRepeatedDnaSequences(String s) {
        Set<String> set=new HashSet<>();
        Set<String> ans=new HashSet<>();
        List<String> list=new ArrayList<>();
        for (int i=0;i<=s.length()-10;i++){
            String s1=s.substring(i,i+10);
            if (set.contains(s1)){
                ans.add(s1);
            }else {
                set.add(s1);
            }
        }
        for (String an : ans) {
            list.add(an);
        }
        return list;
    }

    public static void main(String[] args) {
        System.out.println(new Solution187().findRepeatedDnaSequences("AAAAAAAAAAA"));
    }
}
